package com.example.testapplication.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;

import io.flutter.embedding.android.FlutterActivity;

/**
 * @Date: 2022/4/7 16:02
 */
public class FlutterEngineActivity extends FlutterActivity {

    public final static String INIT_PARAMS = "route";

    public static void startForEngine(Context context, String engineID) {
        context.startActivity(withCachedEngine(engineID).build(context));
    }

    public static void start(Context context, String initParams) {
        Intent intent = new Intent(context, FlutterEngineActivity.class);
        intent.putExtra(INIT_PARAMS, initParams);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
}
